﻿using MVC_Project.BLL;
using Project.DAL;
using Project.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Project.BLL
{
    public class SaleBll : BaseBll<Sale>
    {
        public override void SetDal()
        {
            Dal = new SaleDal();
        }
        public List<Sale> GetSale()
        {
            return base.Query().ToList();
        }
        public List<Sale> GetSaleByPage(int page, int size, out int count)
        {
            var users = base.Query();

            count = users.Count();

            var data = users.OrderBy(u => u.Xsid).Skip((page - 1) * size).Take(size);

            return data.ToList();
        }
    }
}
